package kr.hkit.powerjava.chapter07.work;


class BankAccount {
    int balance;

    void deposit(int amount) {
        balance += amount;
    }

    void withdraw(int amount) {
        if (balance > 0) {
            balance -= amount;
        }
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    void addInterest() {
        balance =(int)(balance * 1.075);
    }

}

public class Leb {

    public static void main(String[] args) {

        BankAccount b = new BankAccount();

        b.setBalance(100);
        b.withdraw(60);
        System.out.println("현재 잔액는 " + b.getBalance() + "원 입니다.");

        b.addInterest();
        System.out.println("이자포함 현재 잔액 " + b.getBalance() + "원 입니다.");
    }
}